<?php

/**
 * This is the model class for table "industripendapatanbersih".
 *
 * The followings are the available columns in table 'industripendapatanbersih':
 * @property integer $ipb_id
 * @property string $ipb_kodejenis
 * @property integer $ipb_penerimaan
 * @property integer $ipb_pengeluaran
 * @property integer $ipb_pendapatankotor
 * @property integer $ipb_pajak
 * @property integer $ipb_pendapatanbersih
 * @property integer $ipb_tahun
 */
class Industripendapatanbersih extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Industripendapatanbersih the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'industripendapatanbersih';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('ipb_penerimaan, ipb_pengeluaran, ipb_pendapatankotor, ipb_pajak, ipb_pendapatanbersih, ipb_tahun', 'numerical', 'integerOnly'=>true),
			array('ipb_kodejenis', 'length', 'max'=>128),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('ipb_id, ipb_kodejenis, ipb_penerimaan, ipb_pengeluaran, ipb_pendapatankotor, ipb_pajak, ipb_pendapatanbersih, ipb_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'ipb_id' => 'Ipb',
			'ipb_kodejenis' => 'Jenis Industri',
			'ipb_penerimaan' => 'Penerimaan',
			'ipb_pengeluaran' => 'Pengeluaran',
			'ipb_pendapatankotor' => 'Pendapatan Kotor',
			'ipb_pajak' => 'Pajak Tidak Langsung',
			'ipb_pendapatanbersih' => 'Pendapatan Bersih',
			'ipb_tahun' => 'Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('ipb_id',$this->ipb_id);
		$criteria->compare('ipb_kodejenis',$this->ipb_kodejenis,true);
		$criteria->compare('ipb_penerimaan',$this->ipb_penerimaan);
		$criteria->compare('ipb_pengeluaran',$this->ipb_pengeluaran);
		$criteria->compare('ipb_pendapatankotor',$this->ipb_pendapatankotor);
		$criteria->compare('ipb_pajak',$this->ipb_pajak);
		$criteria->compare('ipb_pendapatanbersih',$this->ipb_pendapatanbersih);
		$criteria->compare('ipb_tahun',$this->ipb_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}